package com.zj.system.controller;

import com.seventh.common.pojo.R;
import com.zj.system.aop.LogAnnotation;
import com.zj.system.pojo.vo.LogVo;
import com.zj.system.service.impl.LogService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: clms-seventh
 * @description: 日志记录控制层
 * @author: 张静
 * @create: 2021-07-24 10:41
 **/
@RestController
@RequestMapping("system/log")
@ApiModel(value = "日志记录控制层",description = "日志记录控制层")
public class LogController {
    @Autowired
    private LogService logService;
    @ApiModelProperty("搜索分页查询")
    @PostMapping("operlog/{currentPage}/{pageSize}")
    @LogAnnotation(title ="日志接口", action ="查询日志信息",businessType = "0")
    public R selR(@ApiParam("当前显示的页码")@PathVariable("currentPage") Integer currentPage,
                  @ApiParam("每页显示的条数")@PathVariable("pageSize") Integer pageSize,
                  @ApiParam("前端传入的搜索数据")@RequestBody LogVo logVo){
        return logService.sel(pageSize, currentPage, logVo);
    }

    @ApiModelProperty("删除日志信息")
    @DeleteMapping("del/{operId}")
    @LogAnnotation(title ="日志接口", action ="删除日志信息",businessType = "3")
    public R del(@ApiParam("删除日志的日志ID")@PathVariable("operId") Integer operId){
        return logService.del(operId);
    }
}
